/* eslint-disable */
import request from "@/request";

/** getAdminChallengeQuestions GET /api/api/quiz/admin/questions */
export async function getAdminChallengeQuestionsUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getAdminChallengeQuestionsUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseListQuizQuestion_>(
    "/api/api/quiz/admin/questions",
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** createChallenge POST /api/api/quiz/challenge/add */
export async function createChallengeUsingPost(
  body: API.QuizChallenge,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/quiz/challenge/add", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** getChallengeDetail GET /api/api/quiz/challenge/detail */
export async function getChallengeDetailUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getChallengeDetailUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseQuizChallenge_>(
    "/api/api/quiz/challenge/detail",
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** endChallenge POST /api/api/quiz/challenge/end */
export async function endChallengeUsingPost(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.endChallengeUsingPOSTParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/quiz/challenge/end", {
    method: "POST",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** getChallengeLeaderboard GET /api/api/quiz/challenge/leaderboard */
export async function getChallengeLeaderboardUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getChallengeLeaderboardUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseListQuizLeaderboardVO_>(
    "/api/api/quiz/challenge/leaderboard",
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** listChallenges GET /api/api/quiz/challenge/list */
export async function listChallengesUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listChallengesUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageQuizChallenge_>(
    "/api/api/quiz/challenge/list",
    {
      method: "GET",
      params: {
        // pageNum has a default value: 1
        pageNum: "1",
        // pageSize has a default value: 10
        pageSize: "10",
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** getChallengeQuestions GET /api/api/quiz/challenge/questions */
export async function getChallengeQuestionsUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getChallengeQuestionsUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseQuizChallengeQuestionsVO_>(
    "/api/api/quiz/challenge/questions",
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** getChallengeStats GET /api/api/quiz/challenge/stats */
export async function getChallengeStatsUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getChallengeStatsUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseMapStringObject_>(
    "/api/api/quiz/challenge/stats",
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** updateChallenge POST /api/api/quiz/challenge/update */
export async function updateChallengeUsingPost(
  body: API.QuizChallenge,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/quiz/challenge/update", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** getQuizHistory GET /api/api/quiz/history */
export async function getQuizHistoryUsingGet(options?: { [key: string]: any }) {
  return request<API.BaseResponseListQuizRecord_>("/api/api/quiz/history", {
    method: "GET",
    ...(options || {}),
  });
}

/** getUserChallenges GET /api/api/quiz/my/challenges */
export async function getUserChallengesUsingGet(options?: {
  [key: string]: any;
}) {
  return request<API.BaseResponseListUserChallengeVO_>(
    "/api/api/quiz/my/challenges",
    {
      method: "GET",
      ...(options || {}),
    }
  );
}

/** getUserChallengeRecord GET /api/api/quiz/my/record */
export async function getUserChallengeRecordUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getUserChallengeRecordUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseQuizRecord_>("/api/api/quiz/my/record", {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** addQuestion POST /api/api/quiz/question/add */
export async function addQuestionUsingPost(
  body: API.QuizQuestion,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/quiz/question/add", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** addQuestionBatch POST /api/api/quiz/question/batch/add */
export async function addQuestionBatchUsingPost(
  body: API.QuizQuestionBatchRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/quiz/question/batch/add", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** deleteQuestion POST /api/api/quiz/question/delete */
export async function deleteQuestionUsingPost(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteQuestionUsingPOSTParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/quiz/question/delete", {
    method: "POST",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** updateQuestion POST /api/api/quiz/question/update */
export async function updateQuestionUsingPost(
  body: API.QuizQuestion,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/quiz/question/update", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** submitAnswers POST /api/api/quiz/submit */
export async function submitAnswersUsingPost(
  body: API.QuizSubmitRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseQuizRecord_>("/api/api/quiz/submit", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}
